package mx.itesm.wakapanda;



import org.cocos2d.sound.SoundEngine;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;

import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;

public class MainMenu extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.main_menu);
		
		FrameLayout fondo = (FrameLayout)findViewById(R.id.FondoMain);
		AnimationDrawable animacion = (AnimationDrawable)fondo.getBackground();
		animacion.start();
		
		Context contexto = this;
		SoundEngine.sharedEngine().preloadEffect(contexto,R.raw.main_soundscape);
		SoundEngine.sharedEngine().preloadEffect(contexto, R.raw.bongo);
		SoundEngine.sharedEngine().playSound(contexto, R.raw.main_soundscape,
				true);
		
		SoundEngine.sharedEngine().setSoundVolume(1f);
		SoundEngine.sharedEngine().setEffectsVolume(1f);
		
	}

	
	public void cargarHighScores(View v) {
		
		Intent intencion = new Intent(this, HighScores.class);
		startActivity(intencion);
	}
	
public void mostrarAcercaDe(View v){
		
		Intent intencion = new Intent(this, AcercaDe.class);
		startActivity(intencion);
	}

public void mostrarOpciones(View v){
	
	Intent intencion = new Intent(this, Opciones.class);
	startActivity(intencion);
}

public void mostrarHighScores(View v){
	
	Intent intencion = new Intent(this, HighScores.class);
	startActivity(intencion);
	
}


public void start(View v){
	
	Intent intencion = new Intent(this, PantallaJuego.class);
	startActivity(intencion);
	//this.finish();
	
}



@Override
protected void onDestroy() {
	super.onDestroy();
	SoundEngine.sharedEngine().realesAllSounds();
	SoundEngine.sharedEngine().realesAllEffects();
	SoundEngine.purgeSharedEngine();
}

/*@Override

protected void onStop() {
	// TODO Auto-generated method stub
	super.onStop();
	SoundEngine.sharedEngine().pauseSound();
}
*/
@Override
protected void onResume() {
	// TODO Auto-generated method stub
	super.onResume();
	SoundEngine.sharedEngine().resumeSound();
	
	
}





	


}
